package xcc.design.demo.strategy;

import java.math.BigDecimal;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 前端控制器
 */
@Controller
@RequestMapping
public class HelloController {


    @Autowired
    private StrategyContext strategyContext;

    @RequestMapping("calculatePrice")
    public @ResponseBody
    BigDecimal calculatePrice(String memberLevel) {
        return strategyContext.calculatePrice(memberLevel);
    }

}

